package com.evil.application.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.evil.application.pojo.dto.form.control.related.ControlRelatedDTO;
import com.evil.application.pojo.entity.ApplicationFormControl;
import com.evil.application.pojo.entity.ApplicationFormControlRelated;

import java.util.Collection;
import java.util.List;

/**
 * 应用表单控件关联表
 *
 * @author liyang
 * @date 2023-09-25 15:14
 */
public interface ApplicationFormControlRelatedService extends IService<ApplicationFormControlRelated> {

    int updateBatch(List<ApplicationFormControlRelated> list);

    int batchInsert(List<ApplicationFormControlRelated> list);

    /**
     * 获取控件关联
     *
     * @param controlId     controlId
     * @param filterDeleted filterDeleted
     * @return ControlRelatedDTO 列表
     */
    List<ApplicationFormControlRelated> findByControlId(Long controlId, boolean filterDeleted);

    /**
     * 获取控件关联
     *
     * @param controlIds    controlIds
     * @param filterDeleted filterDeleted
     * @return ControlRelatedDTO 列表
     */
    List<ApplicationFormControlRelated> findByControlIds(Collection<Long> controlIds, boolean filterDeleted);

    /**
     * 获取控件关联
     *
     * @param controlId     controlId
     * @param filterDeleted filterDeleted
     * @return ControlRelatedDTO 列表
     */
    List<ControlRelatedDTO> findBaseByControlId(Long controlId, boolean filterDeleted);

    /**
     * 获取控件关联
     *
     * @param controlIds    controlIds
     * @param filterDeleted filterDeleted
     * @return ControlRelatedDTO 列表
     */
    List<ControlRelatedDTO> findBaseByControlIds(Collection<Long> controlIds, boolean filterDeleted);

    /**
     * 保存控件关联
     *
     * @param control             control
     * @param controlRelatedBases controlRelatedBases
     */
    void saveControlRelated(ApplicationFormControl control, List<ControlRelatedDTO> controlRelatedBases);

    /**
     * 赋值控件关联
     *
     * @param source source
     * @param target target
     */
    void copyControlRelated(ApplicationFormControl source, ApplicationFormControl target);

}
